<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('活动列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "system/event";

    var datas = [[${@dict.getType('sys_normal_disable')}]];

    $(function () {
        var options = {
            url: prefix + "/eventlist",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            columns: [{
                radio: true
            },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'eventName',
                    title: '活动名称'
                },
                {
                    field: 'startTime',
                    title: '活动开启时间'
                },
                {
                    field: 'endTime',
                    title: '活动结束时间'
                },
            ]
        };
        $.table.init(options);
    });

    /* 添加用户-选择用户-提交 */
    function submitHandler() {
        var rows = $.table.selectFirstColumns();
        if (rows.length == 0) {
            $.modal.alertWarning("请至少选择一条记录");
            return;
        }
        var rowsData = $.table.selectColumns("eventName");
        parent.$('#eventId').val(rows.join());
        parent.$('#eventName').val(rowsData);
        $.modal.close();
    }
</script>
</body>
</html>